package cn.edu.scau.cmi.chenyipeng.client;

import org.springframework.context.ApplicationContext;

import cn.edu.scau.cmi.chenyipeng.spring.domain.Student;
import cn.edu.scau.cmi.chenyipeng.spring.util.ComprehensionApplicationContextUtil;

public class SingletonSpringACClient {
	
		private static Student student;
		public static void main(String[] args) {
			ApplicationContext ac = getApplicationContextUtil();
			student = (Student)ac.getBean("chenyipeng");
			System.out.println("学生姓名： " + student.getName() + "    导师姓名： " + student.getTeacher().getName());
		}
		
		public static ApplicationContext getApplicationContextUtil() {
			ApplicationContext ac = ComprehensionApplicationContextUtil.getApplicationContext();
			return ac;
		}
}

